import React, { Component } from 'react'

export default class Child5 extends Component {
    constructor(props){
        super(props);
        this.state={
            name:""
        }
    }
    adds(value){
        this.setState({
            name:this.state.name=value
        })
    }
  render() {
    return (
      <div>子组件1要发送的值是<input type="text" value={this.state.name} onChange={(e)=>{this.adds(e.target.value)}}></input><button onClick={()=>{this.props.add(this.state.name)}}>点击发送给父组件</button></div>
    )
  }
}
